You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { Grid, Tab, Tabs, Typography } from '@mui/material';
  2. import { Box, Container } from '@mui/system';
  3. import Image from 'next/image';
  4. import React, { useState } from 'react';
  5. import ProductCard from '../../components/product-card/ProductCard';
  6. import TabPanel from '../../components/tab-panel/TabPanel';
  7. const SingleProduct = () => {
  8. const [value, setValue] = useState(0);
  9. const handleChange = (event, newValue) => {
  10. setValue(newValue);
  11. };
  12. function a11yProps(index) {
  13. return {
  14. id: `simple-tab-${index}`,
  15. 'aria-controls': `simple-tabpanel-${index}`,
  16. };
  17. }
  18. return (
  19. <Box
  20. sx={{
  21. width: '100%',
  22. height: '100%',
  23. display: 'flex',
  24. flexDirection: 'column',
  25. }}
  26. >
  27. <Container
  28. sx={{
  29. width: '1273px',
  30. }}
  31. >
  32. <Typography
  33. fontFamily={'body1.fontFamily'}
  34. fontSize="32px"
  35. sx={{ mt: 25, height: '100%', color: 'primary.main' }}
  36. >
  37. Minimalist Printed Mug
  38. </Typography>
  39. <Grid container spacing={2} sx={{ height: '100%', width: '100%' }}>
  40. <Grid item lg={6}>
  41. <Image
  42. src="/images/product-card-image.jpg"
  43. alt="product"
  44. width={630}
  45. height={390}
  46. />
  47. </Grid>
  48. <Grid item lg={6}>
  49. <Tabs
  50. sx={{
  51. '& button:focus': {
  52. borderTop: '1px solid black',
  53. borderLeft: '1px solid black',
  54. borderRight: '1px solid black',
  55. borderRadius: '5px 5px 0 0',
  56. borderBottom: 'none',
  57. },
  58. }}
  59. value={value}
  60. onChange={handleChange}
  61. aria-label="basic tabs example"
  62. >
  63. <Tab
  64. sx={{
  65. width: '50%',
  66. }}
  67. label="Purchase"
  68. {...a11yProps(0)}
  69. />
  70. <Tab sx={{ width: '50%' }} label="Category" {...a11yProps(1)} />
  71. </Tabs>
  72. <TabPanel value={value} index={0}>
  73. <Box display="flex" flexDirection="row" justifyContent="right">
  74. <Box>
  75. <Typography>
  76. Our simple and sturdy mugs are made to last. With a
  77. minimalist desings you will soon be enjoying your next brew.
  78. </Typography>
  79. </Box>
  80. <Box
  81. justifyContent="flex-end"
  82. sx={{ display: 'flex', flexDirection: 'column' }}
  83. >
  84. <Typography align="right">$20</Typography>
  85. </Box>
  86. </Box>
  87. </TabPanel>
  88. <TabPanel value={value} index={1}>
  89. Mugs & Cups
  90. </TabPanel>
  91. </Grid>
  92. </Grid>
  93. <Typography
  94. sx={{ mt: 25, mb: 5, color: 'primary.main', fontSize: '32px' }}
  95. >
  96. Other Product You May Like
  97. </Typography>
  98. <Grid container spacing={2} sx={{ height: '100%', width: '100%' }}>
  99. <Grid item lg={4}>
  100. <ProductCard />
  101. </Grid>
  102. <Grid item lg={4}>
  103. <ProductCard />
  104. </Grid>
  105. <Grid item lg={4}>
  106. <ProductCard />
  107. </Grid>
  108. </Grid>
  109. </Container>
  110. </Box>
  111. );
  112. };
  113. export default SingleProduct;